<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>TRAP Instruction</title>
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1 class="heading">TRAP Instruction<BR>
</h1>
<hr noshade>
</h1>
<span class="text"><BR>
The instruction TRAP pushes the program counter and the status register on the supervisor stack, switches to supervisor mode and the program counter is given a new value taken from one of the sixteen vectors, given by a four bit data value.<BR>
The instruction is used in applications to call a supervisor program (an OS for example) without knowing exactly where in the memory the OS is.<BR>
        <BR>
ADDRESS METHODS: N/A<BR>
<BR>
DATA LENGTH: N/A<BR>
<BR>
FLAGS: Unaffected<BR>
        <BR>
SYNTAX: TRAP #&lt;vector&gt;<BR>
<BR>
The vector used by TRAP is stored at $80+4*vector (absolute address).</span><p>
<span class="text">EXAMPLE CODE:</span></p>
<p class="sourcecode"><span class="text">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
TRAP #15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EASy68K uses TRAP #15 for 
simulator control.</span></p>
</body>
</html>